# Support whyrun
def whyrun_supported?
    true
end

action :probe do
    if @current_resource.exists
        Chef::Log.info "#{ @new_resource } already exists - nothing to do."
    else
        converge_by("Peer #{ @new_resource }") do
            Chef::Log.info "Do Peer Gluster"
        end
    end
end

action :create do
    if @current_resource.exists
        Chef::Log.info "#{ @new_resource } already exists - nothing to do."
    else
        converge_by("Create #{ @new_resource }") do
            Chef::Log.info "Do Create Gluster Volume"
        end
    end
end

action :delete do
    if @current_resource.exists
        converge_by("Delete #{ @new_resource }") do
            Chef::Log.info "Do Delete Gluster Volume"
        end
    else
        Chef::Log.info "#{ @new_resource } does not exists - nothing to do."
    end
end



def load_current_resource
    @current_resource = Chef::Resource::Gluster.new(@new_resource.name)
    @current_resource.name(@new_resource.name)
    @gluster_props = %w( peer_name volume_name volume_type replica_count bricks )

